/**
 * 学生相关接口
 */
import request from '@/utils/request'

// 获取考试列表
export function getStudentExamList(params) {
  return request({
    url: '/student/exams',
    method: 'get',
    params
  })
}

// 获取考试详情
export function getExamDetail(id) {
  return request({
    url: `/student/exam/${id}`,
    method: 'get'
  })
}

// 提交考试答案
export function submitExam(id, data) {
  return request({
    url: `/student/exam/${id}/submit`,
    method: 'post',
    data
  })
}

// 获取成绩列表
export function getGradeList(params) {
  return request({
    url: '/student/grades',
    method: 'get',
    params
  })
}

// 获取成绩详情
export function getGradeDetail(examId) {
  return request({
    url: `/student/grade/${examId}`,
    method: 'get'
  })
}

// 提交成绩申诉
export function submitAppeal(data) {
  return request({
    url: '/student/appeal',
    method: 'post',
    data
  })
}

// 获取申诉列表
export function getAppealList(params) {
  return request({
    url: '/student/appeals',
    method: 'get',
    params
  })
}

// 撤销申诉
export function cancelAppeal(id) {
  return request({
    url: `/student/appeal/${id}/cancel`,
    method: 'post'
  })
} 